﻿/*
	Copyright 2009 Jason Nottingham

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.


    How to submit a patch:
    1. create or modify a test case (under 'tests') so that it fails to compile/link/run without 
       your change
    2. verify you have the latest sources (resync/merge)
    3. fix or add the missing functionality
    4. verify that your changes fixes the newly broken test case in #1 - it now builds and runs 
       C++ the same as the original C#
    5. create a Subversion-friendly diff or patch file of your changes (including the test cases)
    6. submit your patch at http://gonative.codeplex.com


*/
using System;

namespace GoNative
{
    class Program
    {
        static void Main(string[] args)
        {
            Globals.ShowProgramInfo();
            if (args.Length < 1)
            {
                Console.WriteLine( "This utility attempts to generate C/C++ source from C#.\r\nUsage: GoNative [name of C# solution file]\r\n" );
            }
            else
            {
                foreach (string arg in args)
                {
                    if (arg.EndsWith(".sln"))
                    {
                        SolutionFile slnFile = new SolutionFile(arg);
                        slnFile.Process();
                    }
                    else
                    {
                        // assume it is a project file
                        ProjectFile projectFile = new ProjectFile(arg);
                        projectFile.Process();
                    }
                }
            }
        }
    }
}
